#include "proxy_exports.h"
#include "proxy_functionimport.h"
#include <q_shared.h>
#include <bg_hooks.h>

qboolean cg_messageLitActive = (qboolean)0x2070BF9C;
static unsigned int returnAddress = 0x2011C71C;

void PlayDatapadBeep( void )
{
	//TODO: Make a cvar for this
	cg_messageLitActive = qtrue;
	trap_S_StartSound(NULL, 0, CHAN_AUTO, trap_S_RegisterSound("sound/interface/update.mp3"));
}

__declspec(naked) void PlayDatapadBeep_w(void)
{
	__asm {
		pushad
		call PlayDatapadBeep
		popad
		jmp returnAddress
	}
}


void AlterInterface( void )
{
	/*BYTE *i;
	//Change the interface.

	//NOP out the first five bytes of the section we're hooking to
	for(i = ((BYTE *)0x2011C712); i <= ((BYTE *)0x2011C717); i += 0x00000001)
	{
		PATCH(( unsigned int ) i, unsigned char, 0x90);
		//*((BYTE *)i) = 0x90;
	}
	//Hook the next 5
	i = ((BYTE *)0x2011C712);
	proxyHooks[PHOOK_INTERFACE1] = BG_PlacePatch(PATCH_JUMP, ( unsigned int ) i, ( unsigned int ) PlayDatapadBeep_w );*/
}